﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace markdown_picture_packer.common.constants
{
    public class Constants
    {
        // 匹配Markdown图片语法: ![alt](url)
        public readonly static Regex MD_PIC_PATTERN = new Regex(@"!\[([^\]]+)]\(([^)]+)\)", RegexOptions.IgnoreCase | RegexOptions.Multiline);
        // 匹配HTML图片标签: <img src="url">
        public readonly static Regex HTML_TAG_IMG_PATTERN = new Regex(@"<\s*img\b[^>]*src\s*=\s*['""]([^'""]*)['""][^>]*>", RegexOptions.IgnoreCase | RegexOptions.Multiline);
        public readonly static int MAIN_LINE_HEIGHT = 33;
        public readonly static Font MAIN_FONT = new Font("微软雅黑", 14, FontStyle.Regular);
        public readonly static int EXECUTE_LINE_HEIGHT = 23;
        public readonly static Font EXECUTE_FONT = new Font("微软雅黑", 10, FontStyle.Regular);
        public readonly static string PIC_DIR_NAME = "picture";
        public readonly static string DESKTOP_PATH = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
        public static readonly Dictionary<string, string> MIME_TYPE_EXTENSIONS = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
    {
        { "image/jpeg", ".jpg" },
        { "image/jpg", ".jpg" },
        { "image/pjpeg", ".jpg" },
        { "image/png", ".png" },
        { "image/x-png", ".png" },
        { "image/gif", ".gif" },
        { "image/bmp", ".bmp" },
        { "image/x-bmp", ".bmp" },
        { "image/x-bitmap", ".bmp" },
        { "image/x-xbitmap", ".bmp" },
        { "image/x-win-bitmap", ".bmp" },
        { "image/x-windows-bmp", ".bmp" },
        { "image/webp", ".webp" },
        { "image/tiff", ".tiff" },
        { "image/x-tiff", ".tiff" },
        { "image/svg+xml", ".svg" },
        { "image/svg", ".svg" },
        { "image/x-icon", ".ico" },
        { "image/vnd.microsoft.icon", ".ico" },
        { "image/ico", ".ico" },
        { "image/icon", ".ico" },
        { "text/ico", ".ico" },
        { "image/heic", ".heic" },
        { "image/heif", ".heic" },
        { "image/avif", ".avif" },
        { "image/apng", ".apng" },
        { "image/vnd.wap.wbmp", ".wbmp" },
        { "image/vnd.adobe.photoshop", ".psd" },
        { "image/vnd.djvu", ".djvu" },
        { "image/x-3ds", ".3ds" },
        { "image/x-cmu-raster", ".ras" },
        { "image/x-photoshop", ".psd" },
        { "image/g3fax", ".g3" },
        { "image/fax", ".fax" },
        { "image/dicom-rle", ".dcm" },
        { "image/naplps", ".naplps" },
        { "image/ief", ".ief" },
        { "image/jls", ".jls" },
        { "image/jpx", ".jpx" },
        { "image/jpm", ".jpm" },
        { "image/vnd.valve.source.texture", ".vtf" },
        { "image/vnd.ms-modi", ".mdi" },
        { "image/vnd.ms-photo", ".wdp" },
        { "image/urf", ".urf" },
        { "image/prs.btif", ".btif" },
        { "image/x-tga", ".tga" },
        { "image/x-xpixmap", ".xpm" },
        { "image/x-xwindowdump", ".xwd" },
    };
    }
}
